package com.racer.proxy.protectionproxy.impl;

import com.racer.proxy.protectionproxy.*;
public class PersonBeanImpl implements PersonBean{
    String name;
    String gender;
    String interests;
    int rating;
    int ratingCount;

    public PersonBeanImpl(String name,String gender,String interests,int rating){
        this.name=name;
        this.gender=gender;
        this.interests=interests;
        this.rating=rating;
    }

    public String getName(){
        return name;
    }
    public String getGender(){
        return gender;
    }
    public String getInterests(){
        return interests;
    }
    public int getHotOrNotRating(){
        if(ratingCount==0)
            return 0;
        return (rating/ratingCount);
    }

    public void setName(String name){
        this.name=name;
    }
    public void setGender(String gender){
        this.gender=gender;
    }
    public  void setInterests(String interests){
        this.interests=interests;
    }
    public  void setHotOrNotRating(int rating){
        this.rating+=rating;
        ratingCount++;
    }
}